home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Games of Daze
/
Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso
/
x2ftp
/
msdos
/
source
/
swagg-m
/
misc.swg
/
0041_Convert REAL to INTEGER.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-09-26
|
712b
|
23 lines
{*****************************************************************************
* Function ...... RTOI()
* Purpose ....... To convert a real to an integer
* Parameters .... RealNum Real type number
* Returns ....... The integer part of RealNum
* Notes ......... Simply truncates the decimals
* . Uses function Left
* Author ........ Martin Richardson
* Date .......... May 13, 1992
*****************************************************************************}
FUNCTION RTOI( RealNum: REAL ): LONGINT;
VAR
s: STRING;
l: LONGINT;
i: INTEGER;
BEGIN
STR( RealNum:17:2, s );
s := Left( s, LENGTH(s) - 3 );
VAL( s, l, i );
RTOI := l;
END;